﻿using System.Collections.Generic;

namespace ETModel
{
    /// <summary>
    /// 邮递员,负责将邮筒中的邮件,根据不同的邮筒类型,转发给邮箱(实现IMailboxHandler的类),一个邮筒类型只能有一个类<para/>
    /// 全局唯一
    /// </summary>
    public class MailboxDispatcherComponent : Component
	{
		public readonly Dictionary<string, IMailboxHandler> MailboxHandlers = new Dictionary<string, IMailboxHandler>();

		public override void Dispose()
		{
			if (this.IsDisposed)
			{
				return;
			}
			base.Dispose();

			this.MailboxHandlers.Clear();
		}
	}
}